window.K=window.K||{"URL":{"defaultTemplates":""}};
window._jstemplates=window._jstemplates||{};
K=$.extend(K,{
		"Catalog":{
		"View":null,
		"template":{"name":"default","url":"template.html"},
		"installation":function(){
			K.Catalog.View=Backbone.View.extend({
			    "tagName":"div",
			    "className":"el-wrapper",
			    "template":_.template($("#_template>#t_catalog").text()),
			    "data":false,
				"dataURL":false,
				"wrapper":null,
			    "render":function(json){  
			        this.$el.html(this.template(this.data||json));
			        return this.$el;
			     },"setData":function(data_url){
			    	if(typeof(data_url)=="string")this.dataURL=data_url;
			    	else{this.data=data_url;}
			    	return this;
			     },"to":function($dom){
			    	this.wrapper=$dom;
			    	this.$el.empty();
			    	if(this.data){
			    		this.render(this.data);
			    	}else{
			    		this.render({"title":"EPC Soulutions","levels":[]});
			    	}
			    	$dom.append(this.$el);
			    	return this;
			    }
			});
		},"init":function($dom){
			$dom.empty();
			var cata=new K.Catalog.View();
			cata.to($dom);
			return cata;
		}	
	}
});
$.extend(_jstemplates,{"Catalog":function(cb){
	if($("#_template").length<=0){
		$("body").append($("<div type='text/template' id='_template' />"));
	}
	var arr=[];
	arr.push('<script id="t_catalog" type="text/template">');
	arr.push('<div class="bg-c3">');
	arr.push('<div class="font-left font-c3">{-title}</div>');
	arr.push('<div class="font-right font-c2">');
	arr.push('{for(var i=0;i<levels.length;i++){}');
	arr.push('{if(i==levels.length-1){}');
	arr.push('<a class="current font-c1">{-levels[i]}</a>');
	arr.push('{}else{}{-levels[i]}/');
	arr.push('{}}');
	arr.push('{}}');
	arr.push('</div>');
	arr.push('<div style="clear:both;"></div>');
	arr.push('</div>');
	arr.push('</script>');
	if($("#_template").find("#t_catalog").length<=0)
	$("#_template").append(arr.join(""));
	if(typeof(cb)=="function")cb();
}});